package com.zhaowb.springcloud.gate.service;

import org.springframework.stereotype.Repository;

/**
 * Created with IDEA
 *
 * @author zhaowb
 * @date 2018/11/9 21:21
 */
@Repository
public interface AuthService {

    /**
     * 登录
     *
     * @param clientId id
     * @param secret   秘钥
     * @return
     */
    String login(String clientId, String secret);

    /**
     * 刷新token
     *
     * @param oldToken 旧的token
     * @return
     */
    String refresh(String oldToken);

    /**
     * 校验token
     *
     * @param token    token
     * @param resource 源
     * @return
     */
    Boolean validate(String token, String resource);
}
